<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script src="./index.js"></script>
    <script>
      function bind(fn, thisArg) {
        return function wrap() {
          var args = new Array(arguments.length);
          for (var i = 0; i < args.length; i++) {
            args[i] = arguments[i];
          }
          return fn.apply(thisArg, args);
        };
      }
      let obj = {
        name: "zs",
        age: 12,
      };
      function fn(a, b, c) {
        console.log(this, a, b, c);
      }
      let fnBind = bind(fn, obj);
      fnBind(1, 2, 3);
    </script>
  </body>
</html>
